#include<iostream>
using namespace std;

char trans(int n, int a)
{
	if (n % a < 10)
		return n % a + '0';
	return n % a + 'A' - 10;
}

int main()
{
	int n;
	cin >> n;
	int arr[1000] = { 0 };
	for (int i = 1; i < n; i++)
	{
		for (int j = 1; j <= i; j++)
		{
			int tmp = i * j;
			int k = 0;
			while (tmp)
			{
				arr[k] = tmp % n;
				tmp /= n;
				k++;
			}
			cout << trans(i, n) << "*" << trans(j, n) << '=';
			for (int z = k - 1; z >= 0; z--)
			{
				cout << trans(arr[z], n);
			}
			cout << ' ';
		}
		cout << endl;
	}
}
